import urllib.request
import urllib.parse

# 定义请求的url地址
url = "http://10.12.129.213/api/Account/Login/"

# 定义请求头部信息
headers = {
    "accept": "application/json, text/plain, */*",
    "content-type": "application/json"
}

# 定义请求的数据
params = {
    "username": "xiaosongzhuo",
    "password": "auosong2030.."
}

# 编码查询字符串
query = urllib.parse.urlencode(params)

# 拼接完整的url
url = url + "?" + query

# 创建请求对象
request = urllib.request.Request(url=url, headers=headers)

# 使用urlopen函数发起请求
response = urllib.request.urlopen(request)

# 打印响应状态和内容
print("响应状态", response.status)
print("响应内容", response.read().decode())
